@(customer: Customer, customers: List[Customer])

@main(Some(customer)) {
  
  @customerBanner(customer)

  @if(customers.size > 0) {
    
    <div class="panel-body table-responsive">
      <table class="table table-striped table-hover">
        <thead>
          <tr>
            <th><b>Name</b></th>
            <th><b>Lastname</b></th>
            <th><b>Telephone</b></th>
            <th><b>Email</b></th>
            <th><b>Address</b></th>
            <th><b>City</b></th>
            <th><b>County</b></th>
            <th><b>Postcode</b></th>
            <th></th>
          </tr>
        </thead>
        <tbody>
        @customers.map { cust =>
          <tr class="clickableRow" data-url="@routes.Customers.list(cust.id)">
            <td>@cust.name</td>
            <td>@cust.lastName</td>
            <td>@cust.telephone</td>
            <td>@cust.email</td>
            <td>@cust.address</td>
            <td>@cust.city</td>
            <td>@cust.county</td>
            <td>@cust.postcode</td>
          </tr>
        }
        </tbody>
      </table>
    </div>
    
  } 
}

<script type="text/javascript" charset="utf-8">
    jQuery(document).ready(function($) {
      $(".clickableRow").click(function() {
          window.document.location = $(this).data('url');
      });
});
</script>